package com.hang.ixin.Enums;

import lombok.Getter;

@Getter
public enum AddFriendStatusEnum {
    SUCCESS(0,"成功"),
    USER_NOT_EXSIST(1,"用户不存在"),
    ALREADY_ADDED(2,"已经是好友"),
    URSELF(3,"不能添加自己")
    ;

    private final Integer code;
    private final String msg;

    AddFriendStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMsgByCode(int num){
        for (AddFriendStatusEnum value : values()){
            if (value.getCode() == num) {
                return value.getMsg();
            }
        }
        return null;
    }
}
